package java042;

import java.util.Scanner;

class ArrayUtils{
	static class PairResult{
		private double min;
		private double max;
		public PairResult(double min, double max) {
			super();
			this.min = min;
			this.max = max;
		}
		@Override
		public String toString() {
			return "PairResult [min=" + min + ", max=" + max + "]";
		}
			
	}
	public static PairResult findMinMax(double[] values){
		PairResult p=new PairResult(0, 0);
		p.min=values[0];
		p.max=values[0];
		
		for(int i=0;i<values.length;i++){
			if(p.min>values[i])p.min=values[i];
			if(p.max<values[i])p.max=values[i];
		}
		return p;
	
	}
}
public class Java044 {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in=new Scanner(System.in);
		int n=in.nextInt();
		double[] values = new double[n];
		for(int i=0;i<n;i++){
			values[i]=in.nextDouble();
		}
		System.out.println(ArrayUtils.findMinMax(values).toString());
		System.out.println(ArrayUtils.PairResult.class);
	}

}